nwnfandomcom-20200213-history
Scripts (Shayan's Subrace Engine)
Shayan's Subrace Engine features several scripting enhancements. Constants The following constants are defined in sha_subr_consts. *LIGHT_SENSITIVE_SAVING_THROW_DC specifies the DC of the saving throw that light sensitive subraces must make in sunlight. * LIGHT_BLINDNESS_STRIKES_EVERY_ROUND controls the interval between saving throws that light sensitive subraces must make in sunlight. * LIGHT_STRUCK_BLIND_FOR_ROUNDS governs the duration of the blindness resulting from a failed saving throw by a light sensitive subrace. * APPLY_AB_AND_SAVING_THROW_DECREASES_IN_LIGHT, if set to TRUE, causes light sensitive subraces to suffer attack roll and saving throw penalties. * LIGHT_AB_DECREASE is the size of the penalty suffered by light sensitive subraces. * LIGHT_CAUSES_AB_AND_SAVES_DECREASE_FOR_ROUNDS is the number of rounds that attack and save penalties last for light sensitive subraces. The following ITEM_TYPE_* constants are used by SubraceRestrictUseOfItems(). These are bit-field constants that can be combined with |, the bitwise "or" operator. sha_subr_methds Basic subrace functions This is the primary function of the subrace engine, and should be called in the OnModuleLoad event. No subrace-related functions can be called before this function. Example: In a module's OnModuleLoad event handler include "sha_subr_methds" and use CreateSubrace(RACIAL_TYPE_ELF, "drow", "sha_pc_drow", "sha_subrace_drow", TRUE, 2, FALSE, 0, 1); to create a subrace called "drow" that is light sensitive, taking 2 points of divine damage while in light areas, and that has an effective character level adjustment of +1. This assumes that a skin item with ResRef "sha_pc_drow" has been created (in the Toolset), as well as a cursed plot item with the ResRef "sha_subrace_drow" that contains spell-like abilities and information about the drow subrace. This function adds another race that can be part of the indicated subrace. This function will limit which PCs can be part of this subrace, based upon their first class. Parameters of TRUE allow the indicated class, while FALSE prohibits it. Note that this limitation only applies to the first class. So if a subrace is restricted to fighter, then a wizard/fighter will not meet the criteria, but a fighter/wizard will. This function will limit which PCs can be part of this subrace, based upon their alignment. Parameters of TRUE allow the indicated alignment, while FALSE prohibits it. This alignment restriction only applies when a PC enters the module for the first time. (A database entry is made.) Thus it will not stop a PC from being part of a subrace after the PC changes alignment. This function will give the indicated amount of spell resistance to members of this subrace, with the possibility of the spell resistance varying with character level. This function will cause members of this subrace to have an altered appearance. Note: Some appearances were introduced in the expansion packs, and using the corresponding constants without the expansions may have unexpected results. For example, trying to set the appearance to a black wyrmling when no expansion packs are installed will result in a mephit's appearance. This function causes members of the indicated subrace to have altered ability scores, attack bonus, or armor class during either the day or night, with potential dependence on the current terrain type. This may be used twice per subrace (once with TIME_DAY and once with TIME_NIGHT). Example: First, a SubraceStats structure needs to be created, for example by calling struct SubraceStats mystats = CreateCustomStats(); Once this is done, the designated stat modifiers can be added to a subrace by calling CreateTemporaryStatModifier("mysubrace", mystats, TIME_DAY, TRUE, FALSE); This causes any PC belonging to "mysubrace" to have its ability scores changed during daytime hours when they are in exterior (i.e. outdoors) areas. This function is used to create the structure passed to CreateTemporaryStatModifier(). Example: To reduce a PC's strength by 80%, increase dexterity by 50%, increase constitution by 60%, increase AC by 65%, and reduce AB by 10%, the following code would be used: struct SubraceStats mystats = CreateCustomStats(SUBRACE_STAT_MODIFIER_TYPE_PERCENTAGE, -0.80, 0.50, 0.60, 0.0, 0.0, 0.0, 0.65, -0.10); Then mystats would be used as the second parameter to CreateTemporaryStatModifier(). This function creates restrictions concerning the use of items for a given subrace. AddSubraceFavoredClass() Add a favored class to the subrace. Use this only ONCE per subrace. It will not work correctly if used more than once per subrace This would mean that when determining XP penalty for multiclassing, the favored classes do not apply when determining it Works the same way as default NWN favored classes. (This will work ONLY if you are using the attached Shayan's XP System script). Syntax: void AddSubraceFavoredClass(string subrace, int MaleFavoredClass, int FamaleFavoredClass); NOTE: You can use any playable base CLASS_TYPE_* constant. Do NOT USE Prestige classes, as they are not taken into consideration when determining multiclassing penalty by NWN. Also if you do specify a prestige class it will end up giving players a 20% boost to the XP gained. AddSubraceEffect() Add a permanent or a temporary subrace effect on the PC, during day or night or permanently. Use as many times as desired. Syntax: void AddSubraceEffect(string subrace, int EffectID, int Value1, int Value2, int nDurationType, float fDuration, int TimeOfDay); subrace: Should be the same as the Subrace's name used in CreateSubrace() EffectID: There are a limited number of effects you can use here... EFFECT_TYPE_ARCANE_SPELL_FAILURE EFFECT_TYPE_BLINDNESS EFFECT_TYPE_CHARMED EFFECT_TYPE_CONCEALMENT EFFECT_TYPE_CONFUSED EFFECT_TYPE_CUTSCENEGHOST EFFECT_TYPE_HASTE EFFECT_TYPE_IMMUNITY EFFECT_TYPE_IMPROVEDINVISIBILITY EFFECT_TYPE_INVISIBILITY EFFECT_TYPE_MISS_CHANCE EFFECT_TYPE_MOVEMENT_SPEED_DECREASE EFFECT_TYPE_MOVEMENT_SPEED_INCREASE EFFECT_TYPE_POLYMORPH EFFECT_TYPE_REGENERATE EFFECT_TYPE_SANCTUARY EFFECT_TYPE_SLOW EFFECT_TYPE_TEMPORARY_HITPOINTS EFFECT_TYPE_TRUESEEING EFFECT_TYPE_ULTRAVISION EFFECT_TYPE_VISUALEFFECT Value1: This is the value of the first parameter (from left) that you can input for the effect. IE: If you choose EFFECT_TYPE_CONCEALMENT, which means the effect applied will be: EffectConcealment(int nPercentage, int nMissType=MISS_CHANCE_TYPE_NORMAL) Thus Value1 will be the value of nPercentage. YOU MUST INPUT A VALUE! IF NOT THE SCRIPT WILL PUT IN 0!! Value2: This is the value of the second parameter you can input for the effect. IE: (Refer to Value1's example) This will be the value of nMissType. YOU MUST INPUT A VALUE! IF NOT THE SCRIPT WILL PUT IN 0!! nDurationType: Duration type of the effect being applied... DURATION_TYPE_INSTANT, DURATION_TYPE_PERMANENT, or DURATION_TYPE_TEMPORARY. fDuration: The number of seconds the effect should last for... (Put 0.0 if you are making it last "forever" -IE: Whole of day time, or night time or permanetly) TimeOfDay: The time of day you want this applied. Use TIME_BOTH if you want this permanently applied on the PC. AddAdditionalSkinsToSubrace() Add a different skin to the subrace at specified level. (Use as many times as desired) Use as many times as desired. Syntax: void AddAdditionalSkinsToSubrace(string subrace, string SkinResRef, int EquipLevel, int iTime = TIME_BOTH); subrace: Should be the same as the Subrace's name used in CreateSubrace() SkinResRef: The Blueprint ResRef of the skin that you want the subrace to be equipped. EquipLevel: The level at which you want the skin to be applied. iTime: The time at which you want the skin to be equipped. (Use TIME_DAY, TIME_NIGHT, or TIME_BOTH.) Example: You want to add a skin for the subrace Illithid to use at level 15, during day time. Then call onModuleLoad script: AddAdditionalSkinsToSubrace("Illithid", "my_illithid_skin", 15, TIME_DAY); (Where "my_illithid_skin" is the resref of the skin you want equipped.) Note: If you say add a skin for a subrace to be equipped at level 15, then all PCs belonging to the subrace above level 15 will also use the same skin for that time -unless you add a different skin for those levels.) AddClawsToSubrace() Add equipable creature claws to the subrace. This allows you to add 'Claws' to your subrace. You simply specify the Blue print resref of the claw you want equipped on the player, and at what level. Use as many times as desired. (You can use this to equip claws/slams/gore or what ever else that maybe equipped in a PC's claw item slots) Syntax: void AddClawsToSubrace(string subrace, string RightClawResRef, string LeftClawResRef , int EquipLevel, int iTime = TIME_BOTH); subrace: Should be the same as the Subrace's name used in CreateSubrace() RightClawResRef: The resref of the right hand claw. (Use "" if you do not want to specify a claw, use "none" if you want any existing right claws to be removed from the player.) LeftClawResRef: The resref of the left hand claw. (Use "" if you do not want to specify a claw, use "none" if you want any existing right claws to be removed from the player.) EquipLevel: The level at which these claws should be equipped. NOTE: 1. Make sure the PCs have weapon proficiency in creature weapons!!! I can't stress this enough. (Give the feat through the subrace Skin) 2. If you are going to use one claw, make sure it is the right claw. 3. Also note that you need not change both claws at once. (IE: Say you equipped a right and left claw at level 5, then say at level 10, if you want to change the left claw then you only need to specify the resref of the left claw... the PC keeps the existing right claw.) SetupSubraceSwitch() Switch the player from one subrace to another This allows you to switch a player from one subrace to another. (Use only once per Level) Syntax: void SetupSubraceSwitch(string subrace, string switchSubraceName, int Level, int MustMeetRequirements = TRUE); subrace: Should be the same as the Subrace's name used in CreateSubrace() switchSubraceName: The syntax of the subraces, you wish to switch the player (Should be the same as whatever the new subraces' name used in it's CreateSubrace()) Level: The level at which this switch should take place. MustMeetRequirements: Set to FALSE, if you want the switching to bypass any class/race/alignment restriction the new subrace might have. If MustMeetRequirements set to TRUE, and the character fails to meet a requirement... then they will continue on as part of their current sub-race. IDEA: You can set the subrace you want the player to switch to as a hidden and unaccessible subrace for new characters, by setting PrestigiousSubrace to TRUE, in CreateSubrace(). That way, players must earn their way to this new subrace (switchSubraceNames). Example: IE: If I had set up three subraces like: CreateSubrace(RACIAL_TYPE_HUMAN, "illithid", "sha_pc_illithid", "sha_subrace_illi", TRUE, 0, FALSE, 0, 3); (Along with other setting for subrace, like class restrictions, appearance, additional skins, etc) CreateSubrace(RACIAL_TYPE_HUMAN, "vampire", "sha_pc_vamp001", "sha_subrace_vamp", TRUE, 2, FALSE, 0, 3, TRUE); Can only be evil. CreateSubraceAlignmentRestriction("vampire", FALSE, FALSE, TRUE); (Along with other setting for subrace, like class restrictions, appearance, additional skins, etc) CreateSubrace(RACIAL_TYPE_HUMAN, "wolkier", "sha_pc_wolk", "sha_subrace_wolk", TRUE); Can only be Neutral;. CreateSubraceAlignmentRestriction("wolkier", FALSE, TRUE, FALSE); (Along with other setting for subrace, like class restrictions, appearance, additional skins, etc) And I wished that PCs belonging to illithid be switched to vampire or wolkier at level 15, depending on which criteria they meet, then I would call: SetupSubraceSwitch("illithid", "vampire_wolkier", 15, TRUE); If I didn't want the alignment criteria to be check during switching then I would call: SetupSubraceSwitch("illithid", "vampire_wolkier", 15, FALSE); The order in which you choose the subrace to be switched is important. If the player can meet both requirements, it gives prioirty to the first one. You can put in any number of subraces to switch to.. IE: SetupSubraceSwitch("illithid", "vampire_wolkier_pixie_shadow", 8, TRUE); If a player doesn't meet the criteria for any one of the subraces, he/she wil remain part of thier usual/current subrace. You can use SetupSwitchSubrace() as many times as you like. EG: SetupSubraceSwitch("illithid", "vampire_wolkier_pixie_shadow", 12, TRUE); SetupSubraceSwitch("illithid", "air-genasi_underminion", 18, TRUE); SetupSubraceSwitch("illithid", "mindbreaker_telephathest_darkmoon", 32, TRUE); SetupSubraceSwitch("illithid", "greatone", 40, FALSE); Where: vampire, wolkier, pixie, shadow, air-genasi, underminion, mindbreaker, telephathest, darkmoon, and greatone are all subraces. Note: In order for this to work the subrace you wish to switch the player to does NOT have to be marked as prestigious. AddSubraceItem() Give the player belonging to a subrace, additional unique items This allows you to give players belonging to a subrace additional unique items, at any level. (Use as many times as desired for any levels) Syntax: void AddSubraceItem(string subrace, string ItemResRef, int Level = 1); subrace: Should be the same as the Subrace's name used in CreateSubrace() ItemResRef: The blueprint res-ref of the item to give. Level: The level at which to give the item. Example: Say I wanted to give my players belonging to the vampire subrace, an armour and a scythe at level 2. And then an amulet at level 10. The armor's resref is: "sha_vamp_arm" The scythe's resref is: "sha_vamp_scythe" The amulet's resref is: "sha_vamp_ammy" So I simply call: AddSubraceItem("vampire", "sha_vamp_arm", 2); AddSubraceItem("vampire", "sha_vamp_scythe", 2); AddSubraceItem("vampire", "sha_vamp_ammy", 10); NOTE: You can only give ONE item of each. IE: You CAN'T do this expecting to give 2 amulets: AddSubraceItem("vampire", "sha_vamp_ammy", 10); AddSubraceItem("vampire", "sha_vamp_ammy", 10); SetupSubraceAlias() Setup an alias for your subrace. Allows you to use two or more "names" for the same subrace without having to add it twice. See SSE_TREAT_ALIAS_AS_SUBRACE in sha_subr_consts for more info. Syntax: void SetupSubraceAlias(string subrace, string Alias); CreateSubracePrestigiousClassRestriction() Setup a Prestige class restriction for a 'Prestige' subrace. This will only be checked during a 'subrace switch' for obvious reasons. Refer to SetupSubraceSwitch(...) Syntax: void CreateSubracePrestigiousClassRestriction(string subrace, int MinimumLevels = 1, int CanBe_ArcaneArcher = TRUE, int CanBe_Assasin = TRUE, int CanBe_Blackguard = TRUE, int CanBe_ChampionOfTorm = TRUE, int CanBe_RedDragonDisciple = TRUE, int CanBe_DwarvenDefender = TRUE, int CanBe_HarperScout = TRUE, int CanBe_PaleMaster = TRUE, int CanBe_ShadowDancer = TRUE, int CanBe_Shifter = TRUE, int CanBe_WeaponMaster = TRUE); subrace Should be the same as the Subrace's name used in CreateSubrace(). MinimumLevels The minimum number of levels in a/any particular prestigious class allowed to pass the restriction. CanBe_ Set CanBe_ values as desired. Example: Say I have a subrace 'Phantasm' and I wanted to add a restriction so that only Shadow Dancers, Blackguards, and Assasin can be part of. AND they must have atleast 5 levels in any of those classes. So I set: CreateSubracePrestigiousClassRestriction("phantasm", 5, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE); A player with class combination like /Assasin(2)/ShadowDancer(3) will meet this criteria. NOTE: This can be used in combination with CreateSubraceClassRestriction(...) If you wanted to you can also set-up a primary/base class restriction with CreateSubraceClassRestriction(...) and also create a Prestigious class restriction with this. ModifySubraceAppearanceAttachment() Add wings or tail to the subrace You may use this as many times as desired. Syntax: void ModifySubraceAppearanceAttachment(string subrace, int Male_Wings = 0, int Female_Wings = 0, int Male_Tail = 0, int Female_Tail = 0, int Level = 1); subrace: Should be the same as the Subrace's name used in CreateSubrace() Male_Wings: The wing to be added for a male character: Use any APPEARANCE_TYPE_ATTACHMENT_WINGS_* constant. Female_Wings: The wing to added for a female character: Use any APPEARANCE_TYPE_ATTACHMENT_WINGS_* constant. Male_Tail: The tail to be added for a male character: Use any APPEARANCE_TYPE_ATTACHMENT_TAIL_* constant. Female_Tail: The tail to be added for a female character: Use any APPEARANCE_TYPE_ATTACHMENT_TAIL_* constant. Level: The level at which to add these attachments. NOTE: If you are using any of the CEP tails or wings, your server/module must have CEP. Example of Usage: Say I want to add bird like wings to the male character, and angel wings to the female character at level 21: I also want to change the male wings to devil and the female to red dragon disciple's, and add a bone tail to both genders at level 36. AddSubraceAppearanceAttachment("mysubrace", APPEARANCE_TYPE_ATTACHMENT_WINGS_BIRD, APPEARANCE_TYPE_ATTACHMENT_WINGS_ANGEL, 0, 0, 21); AddSubraceAppearanceAttachment("mysubrace", APPEARANCE_TYPE_ATTACHMENT_TAIL_DEVIL, APPEARANCE_TYPE_ATTACHMENT_WINGS_RED_DRAGON_DISCIPLE, APPEARANCE_TYPE_ATTACHMENT_TAIL_BONE, APPEARANCE_TYPE_ATTACHMENT_TAIL_BONE, 36); CreateSubraceGenderRestriction() Use to restrict subrace's gender Syntax: void CreateSubraceGenderRestriction(string subrace, int CanBeMale = TRUE, int CanBeFemale = TRUE); subrace: Should be the same as the Subrace's name used in CreateSubrace() CanBeMale: Set to FALSE if you do not want the subrace to be playable by Male characters CanBeFemale: Set to FALSE if you do not want the subrace to be playable by Female characters Example of useage: Say I want my subrace "Pixie" only be playable by Female characters... then I would call: CreateSubraceGenderRestriction("pixie", FALSE, TRUE); ChangePortrait() Use to the portrait of a character List of portraits' file names can be found in portraits.2da. You may use this as many times as desired. Syntax: void ChangePortrait(string subrace, string MalePortrait, string FemalePortrait, int Level = 1); subrace: Should be the same as the Subrace's name used in CreateSubrace() MalePortrait: Set the name of the male portrait. FemalePortrait: Set the name of the female portrait. Level: The level at which to change the portrait. NOTE: This function will correclty set the portraits. But whether or not other players or the player him/herself can see it depends on whether they have portrait in their portrait folder or the expansion packs containing the portraits. (Like in the below for example: The Queen Shao's portrait is only included in HoTU. So if the player does not have Queen Shao's portraits in his/her portrait folder will not be able to see them. And other players without HoTU will not be able to see the player's portrait) NOTE 2: If you want to use any of the standard portraits (That is any from NWN) make sure you have "po_" as prefix. IE: If you want to use the portrait set 'el_f_04_' (as listed in portraits.2da) the actual name is: po_el_f_04_. (Some portraits in the standard library do not use the po_ prefix... and there is no way to tell other than by trial and error) Example of Useage: Say I have the Queen Shao's portraits. These portraits are po_queenshao_h, po_queenshao_l, po_queenshao_m, po_queenshao_s, and po_queenshao_t. So this means that this portrait set is refered to by: po_queenshao_ Likewise say I have another portrait set: my_male_port_ And say I want to set Queen Shao's portrait to all the female players, and my other portrait set to the male characters at level 6. So I would call: ChangePortrait("mysubrace", "my_male_port_", "po_queenshao_", 6); ModifySubraceFaction() Use to set-up an automated change in the subrace's faction Syntax: void ModifySubraceFaction(string subrace, string FactionCreatureTag, int Reputation = SUBRACE_FACTION_REPUTATION_HOSTILE); string subrace: Should be the same as the Subrace's name used in CreateSubrace() string FactionCreatureTag: The tag of the creature whose perception of the subrace will be adjusted. int Reputation: Use any SUBRACE_FACTION_REPUTATION_* constants. Example of function usage: Say I have a NPC faction called 'Drow Faction'. This faction will normally attack (Hostile) player character. But I want to have the players belonging to the 'Drow' subrace be treated friendly, by the NPCs belonging to this faction... So inorder to do this; first I will need to create: An NPC in a LOCKED room (IE: no player can enter), I would remove all weapons and items from this NPC. Set it as Immortal (NOT Plot). Set it's tag to say: MY_DROW_FACTION_NPC And then call this function: ModifySubraceFaction("drow", "MY_DROW_FACTION_NPC", SUBRACE_FACTION_REPUTATION_FRIENDLY); CreateSubraceStartLocation() Setup a start location for a subrace This will teleport the player belonging to the Subrace 'subrace' to the waypoint, when they enter the module. Syntax: void CreateSubraceStartLocation(string subrace, string WaypointTag); subrace: Should be the same as the Subrace's name used in CreateSubrace() WaypointTag: The Tag of the waypoint to which the player will be ported to. LetoScript functions ModifySubraceFeat() Add/remove a feat to/from the character belonging to a subrace You may use this as many times as desired. Syntax: void ModifySubraceFeat(string subrace, int FeatID, int Level = 1, int Remove = FALSE); subrace: Should be the same as the Subrace's name used in CreateSubrace() FeatID: Use any FEAT_* constants. Remove: If set to TRUE, it will remove the the feat from the player. Level: Level at which to give this bonus feat. NOTE: Player must have the required expansion packs for the feats. IE: If you were to give Epic Dodge, the player must have HoTU expansion pack installed inorder to recieve/use the feat. Example of Usage: Say I want to give Disarm at level 5, and improved knockdown at level 8 to the players belonging to Drow subrace. I also want to remove Alterness from the player at level 10. ModifySubraceFeat("drow", FEAT_DISARM, 5); ModifySubraceFeat("drow", FEAT_IMPROVED_KNOCKDOWN, 8); ModifySubraceFeat("drow", FEAT_ALERTNESS, 10, TRUE); CreateBaseStatModifier() Create custom base stats This is used in conjunction with CreateBaseStatModifier(...) -refer to it for more details. Fill in the Modifiers as desired. For speed modification use any MOVEMENT_SPEED_* constant. Use to make PERMANENT changes to the ability scores or movement speed of the character This is used in conjunction with SubraceBaseStatsModifier CustomBaseStatsModifiers(...) You may use this as many times as desired. Syntax: void CreateBaseStatModifier(string subrace, struct SubraceBaseStatsModifier Stats, int Level = 1, int Set = FALSE); subrace: Should be the same as the Subrace's name used in CreateSubrace() SubraceBaseStatsModifier: Use CustomBaseStatsModifiers(...) to create the stats. Level: The level at which to make these changes. Set: If you set it to TRUE, then these stats will REPLACE (instead of adding or subtracting) the player's stats. Example: I want to increase Strength by 6, decrease Dexterity by 4, increase Consitution by 4, and change the movement speed to fast. So I would call: struct SubraceBaseStatsModifier MyStats = CustomBaseStatsModifiers(6, -4, 4, 0, 0, 0, MOVEMENT_SPEED_FAST); struct SubraceBaseStatsModifier CustomBaseStatsModifiers(int StrengthModifier, int DexterityModifier, int ConstitutionModifier, int IntelligenceModifier, int WisdomModifier, int CharismaModifier, int MovementSpeedModifier); Example 2: Say I have a subrace called: black-dragon. And I want to increase Strength by 6, decrease Dexterity by 4, increase Consitution by 4, and decrease charisma by 2, and change the movement speed to fast at level 10. So I would call: struct SubraceBaseStatsModifier MyStats = CustomBaseStatsModifiers(6, -4, 4, 0, 0, -2, MOVEMENT_SPEED_FAST); CreateBaseStatModifier("black-dragon", MyStats, 10); ChangeSoundSet() Use to the soundset of the character You may use this as many times as desired. Syntax: void ChangeSoundSet(string subrace, int MaleSoundSet, int FemaleSoundSet, int Level = 1); subrace: Should be the same as the Subrace's name used in CreateSubrace() MaleSoundSet: Refer to the table in the PDF guide book and enter the 'Reference Number'. FemaleSoundSet: Refer to the table in the PDF guide book and enter the 'Reference Number'. Level: The level at which to change the soundset. Example of Useage: Say I want to change the Male character's soundset to Minotaur, Chief and the Female character's soundset to Succubusat level 16. And then at level 25 change it to Ogre and Nymph. The numbers are 65 for Minotaur Chief, 90 for the Succubus, 70 for Ogre, and 197 for the Nymph soundsets). ChangeSoundSet("mysubrace", 65, 90, 16); ChangeSoundSet("mysubrace", 70, 197, 25); ModifySubraceSkill() Modify a skill a character belonging to a subrace has Syntax: void ModifySubraceSkill(string subrace, int SkillID, int iModifier, int Level = 1, int Set = FALSE); subrace: Should be the same as the Subrace's name used in CreateSubrace() SkillID: Use any SKILL_* constants. iModifier: The value to increase or decrease or set the skill by/to. Set: If set to TRUE, the skill points in the chosen skill will be set to the value of iModifier. Example of Usage: Say I want to increase Spot skill by 15, and decrease Search by 12 at level 10, and set Tumble to 5 at level 16. I would call: ModifySubraceSkill("mysubrace", SKILL_SPOT, 15, 10); ModifySubraceSkill("mysubrace", SKILL_SEARCH, -12, 10); ModifySubraceSkill("mysubrace", SKILL_TUMBLE, 5, 16, TRUE); ModifySubraceAppearanceColors() Use to setup different skin and hair colors for subrace Syntax: void ModifySubraceAppearanceColors(string subrace, int Male_Hair = -1, int Female_Hair = -1, int Male_Skin = -1, int Female_Skin = -1, int Level = 1); subrace: Should be the same as the Subrace's name used in CreateSubrace() Male_Hair: Refer to the guide book for which number represents which color Female_Hair: Refer to the guide book for which number represents which color Male_Skin: Refer to the guide book for which number represents which color Female_Skin: Refer to the guide book for which number represents which color Level: the level at which this change is to take place. CreateSubraceSpecialRestriction() Use to setup a special subrace restriction Syntax: void CreateSubraceSpecialRestriction(string subrace, int Type, string VarName, int Existance=TRUE, string Database=""); subrace: Should be the same as the Subrace's name used in CreateSubrace() Type: The type of special restriction (e.g. item, variable etc) See SUBRACE_SPECIAL_RESTRICTION_* VarName: The variable name if a variable or the tag if item (etc.) Existance: if TRUE then this variable/item must exist, if FALSE it must not exist. Database: The name of the database or the tag of the item, which holds the variable (not used for "must have item" restriction). if Database is empty it will default to SUBRACE_DATABASE (if Database) or the Player (if Local var) Module functions SubraceOnClientEnter Add this on the Module OnClientEnter script. Syntax: void SubraceOnClientEnter(object oPC = OBJECT_INVALID); SubraceOnPlayerRespawn() Add this to Module OnPlayerRespawn script. Syntax: void SubraceOnPlayerRespawn(); SubraceOnPlayerLevelUp() Add this to Module OnPlayerLevelUp script. Syntax: void SubraceOnPlayerLevelUp(); SubraceOnPlayerEquipItem() Add this to Module OnPlayerEquipItem script. Syntax: void SubraceOnPlayerEquipItem(); SubraceOnItemActivated() Add this to the Module OnItemActivated script. Syntax: void SubraceOnItemActivated(); SubraceHeartbeat() Subrace Heartbeat function - For use in clock Syntax: void SubraceHeartbeat(object oPC = OBJECT_SELF); SubraceOnClientLeave() Add this to the Module OnClientLeave script. Syntax: void SubraceOnClientLeave(); GetIsSSEDisabled() Returns TRUE if SSE has been disabled serverwide. This check does NOT care if SSE has been disabled in the current area. Syntax: int GetIsSSEDisabled(); GetIsSSEDisabledInArea() Returns TRUE if SSE has been disabled in Area. This check does NOT care if SSE has been disabled Serverwide. returns FALSE on error (e.g. if input is non an area) Syntax: int GetIsSSEDisabledInArea(object Area); GetSSEStatus() Returns SSE_STATUS_OPERATIONAL if SSE is running properly. Else it returns a flag depending on the issue. See SSE_STATUS_* constants. It adds all that applies. If a non-valid area is supplied, area check is skipped. Syntax: int GetSSEStatus(object Area=OBJECT_INVALID); SubraceForceUnequipItem() Force the player to properly un-equip the item. Syntax: void SHA_SubraceForceUnequipItem(object oItem); SHA_SubraceForceEquipItem() Force the player to properly equip oItem in the inventory slot: InvoSlot. Syntax: void SHA_SubraceForceEquipItem(object oItem, int InvoSlot); GetSubraceXPModifier() Return the XP modifier for being part of the Subrace (Calclates modifer value for Subrace Favored classes) Syntax: float GetSubraceXPModifier(object oPC); Subrace_GetIsUndead() Returns TRUE if the player is marked as being part of an undead subrace. Returns FALSE if player is not an undead OR provided character is NOT a PC! Syntax: int Subrace_GetIsUndead(object oPC); GetECL() Returns the Effective Character level of oPC. Syntax: int GetECL(object oPC); DeleteSubraceInfoOnPC() Deletes every bit of subracial information stored on the PC. Also destroys equipped skins and claws. Set ClearSubraceField to TRUE if you wish, to have their Subrace field cleared (set to "") after this is done. If you don't SSE will assume they are new to the subrace and re-initiate them to the subrace at next login (assuming they still meet the demands) Syntax: void DeleteSubraceInfoOnPC(object oPC, int ClearSubraceField=FALSE); ChangeToPCDefaultAppearance() Change the PC to his/her default humaniod appearance. IE: If the player is human and his/her appearance is Illithid, this will turn them back to looking like human again. Syntax: void ChangeToPCDefaultAppearance(object oPC); GetIsPCLightSensitive() Returns TRUE if PC belongs to a subrace which is Light sensitive. Syntax: int GetIsPCLightSensitive(object oPC); Subrace_GetFavouredClass() Return the Favored class of the PC. Returns -1 if there is none. Syntax: int Subrace_GetFavouredClass(object oPC); SHA_SendSubraceMessageToPC() Send's a message to PC, with a Subrace Engine title. Set Important to TRUE if it is an important message. (Refer to sha_subr_consts for more info.) Syntax: void SHA_SendSubraceMessageToPC(object oPC, string message, int Important = TRUE); SSE_MessageHandler() Send's a message to PC with a Subrace Engine title. This will follow the new message standards and allow very selective messages. If you wish to use this for non-standard-SSE messages, MessageReference should be MESSAGE_USER_MADE. VariableText will then be directly displayed (With Subrace Engine title) MessageType must contain the MESSAGE_TYPE_* constants, for user made messages! Syntax: void SSE_MessageHandler(object Receiver, int MessageReference, string VariableText="", string VariableText2="", int MessageType = MESSAGE_TYPE_DEFAULT); NOTE: MESSAGE_TYPE_VITAL will ALWAYS be displayed REGARDLESS of settings and MESSAGE_TYPE_LOG will ALWAYS be logged! (Assuming there is a message to send/log) SearchAndDestroySkinsAndClaws() Traverses through oPC's inventory, destroying all Skins, and creature items. Syntax: void SearchAndDestroySkinsAndClaws(object oPC); ClearSubraceEffects() Removes temporary subrace ability scores and AB boosts. Syntax: void ClearSubraceEffects(object oPC); SHA_GetCurrentTime() Returns TIME_DAY, or TIME_NIGHT depending on the current hour of day. Syntax: int SHA_GetCurrentTime(); SHA_GetDefaultAppearanceType() Returns the default appearance type of oPC. (It ignores any appearance change by SetAppearance()). Syntax: int SHA_GetDefaultAppearanceType(object oPC); NOTE: oPC must be a player character in order for this to work. LoadSubraceFromScript() This will load scripts containing sub-races. You can use the Conditions parameter if you want to make the script load only if Leto is (or is not) enabled. Syntax: void LoadSubraceFromScript(string Script, int Conditions=SSE_SUBRACE_LOADER_CONDITION_ALWAYS_LOAD); ApplySubrace() Switch oTarget's subrace to Subrace Takes approximately 12 - 15 seconds to complete. Syntax: void ApplySubrace(object oTarget, string Subrace); Note: this function does not do any checking, to see if oTarget meets any alignment or race criteria. Should be used with caution. SSE_ModuleLoadEvent() Use this on the OnModuleLoad script to signal that the subraces has been loaded and we are good to go. If you do not call this one, SSE will wait forever! It has an internal delay and will wait up 30 seconds for other sub-race scripts to load. doNWNXInit is used to call the NWNX Init "NWNX!INIT" with parameter "1". set to TRUE if you do not have an external call to it and plan on using NWNX (Leto or NWNX database) Syntax: void SSE_ModuleLoadEvent(int doNWNXInit=FALSE); NOTE: After the first sub-race load has been detected, further 5 seconds are given to finish the loading. After that SSE will not wait any further! It is adviced to have all your subraces load within 5 seconds of each other! (If you use LoadSubraceFromScript(), you do not have to worry about this) GetSubraceNameByAlias() Use this to get the base race of the alias. if Alias is the base race then it returns itself. returns "" if the Alias is not valid/no such subrace exist if Lowercase is TRUE it will return a lowercased string Syntax: string GetSubraceNameByAlias(string Alias, int Lowercase=FALSE); GetSubraceNameByID() Use this to get the race name of the ID. returns "" if the Alias is not valid/no such subrace exist if Lowercase is TRUE it will return a lowercased string Syntax: string GetSubraceNameByID(int ID, int Lowercase=FALSE); GetPlayerSubraceID() Returns the Player's Subrace ID. Syntax: int GetPlayerSubraceID(object Player); SSE_Message_AddDisplayType() This will add MessageType too the list of message types that is SSE may display If no list is present, a new (empty) list will be created and the type will be added to it. Syntax: void SSE_Message_AddDisplayType(int MessageType); NOTE: Vital will ALWAYS be displayed and Log will ALWAYS be logged! SSE_Message_RemoveDisplayType() This will remove MessageType from the list of message types that is SSE may display If no list is present, it is assumed you want to use the server default without this type! Syntax: void SSE_Message_RemoveDisplayType(int MessageType); NOTE: Vital will ALWAYS be displayed and Log will ALWAYS be logged! SSE_Message_SetDisplayType() Creates a new list of the Message types SSE that is allowed to display with MessageType as an entry the old list will be deleted. Syntax: void SSE_Message_SetDisplayType(int MessageType); NOTE: Vital will ALWAYS be displayed and Log will ALWAYS be logged! SSE_Message_GetDisplayType() returns the list of message types SSE is allowed to display. if no list is present, MESSAGE_TYPE_SERVER_DEFAULT or FALSE will be returned depending on DoNotReturnServerDefault Syntax: int SSE_Message_GetDisplayType(int DoNotReturnServerDefault=FALSE); SSE_HorseAddHorseMenu() Gives the 169 horse menu feat to oPC's hide. Syntax: void SSE_HorseAddHorseMenu(object oPC) category:alternate rulesets